<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Finalizes all add/deletes made to the index</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="solrclient.adddocuments.html">SolrClient::addDocuments</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="solrclient.construct.html">SolrClient::__construct</a></div>
 <div class="up"><a href="class.solrclient.html">SolrClient</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="solrclient.commit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SolrClient::commit</h1>
  <p class="verinfo">(PECL solr &gt;= 0.9.2)</p><p class="refpurpose"><span class="refname">SolrClient::commit</span> &mdash; <span class="dc-title">Finalizes all add/deletes made to the index</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-solrclient.commit-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><a href="class.solrupdateresponse.html" class="type SolrUpdateResponse">SolrUpdateResponse</a></span> <span class="methodname"><strong>SolrClient::commit</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$maxSegments</code><span class="initializer"> = &quot;1&quot;</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$waitFlush</code><span class="initializer"> = true</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$waitSearcher</code><span class="initializer"> = true</span></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   This method finalizes all add/deletes made to the index.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-solrclient.commit-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">maxSegments</code></em></dt>

     <dd>

      <p class="para">
       Optimizes down to at most this number of segments. Since Solr 1.3
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">waitFlush</code></em></dt>

     <dd>

      <p class="para">
       Block until index changes are flushed to disk.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">waitSearcher</code></em></dt>

     <dd>

      <p class="para">
       Block until a new searcher is opened and registered as the main query searcher, making the changes visible. 
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-solrclient.commit-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a SolrUpdateResponse object on success or throws a SolrClientException on failure.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-solrclient.commit-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="solrclient.optimize.html" class="methodname" rel="rdfs-seeAlso">SolrClient::optimize()</a> - Defragments the index</span></li>
    <li class="member"><span class="methodname"><a href="solrclient.rollback.html" class="methodname" rel="rdfs-seeAlso">SolrClient::rollback()</a> - Rollbacks all add/deletes made to the index since the last commit</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="solrclient.adddocuments.html">SolrClient::addDocuments</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="solrclient.construct.html">SolrClient::__construct</a></div>
 <div class="up"><a href="class.solrclient.html">SolrClient</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
